/*
 * Powered By XY
 * Since 2020
 */

package com.xy.biz.base.manager.impl;

import java.util.Collection;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.xy.biz.base.domain.bo.SupplierBO;
import com.xy.biz.base.domain.query.SupplierQuery;
import com.xy.biz.base.domain.converter.SupplierConverter;
import com.xy.biz.base.manager.SupplierManager;
import com.xy.biz.base.dao.SupplierDao;

/**
 * 
 * 
 * @author zgy
 * @date 2021-9-22
 */
@Service
public class SupplierManagerImpl implements SupplierManager {

	@Autowired
	private SupplierDao supplierDao;
	
	@Override
	public int saveSupplier(SupplierBO supplierBO) {
		return supplierDao.saveSupplier(SupplierConverter.toPO(supplierBO));
	}
	
	@Override
	public int saveAllSupplier(Collection<SupplierBO> collection) {
		return supplierDao.saveAllSupplier(SupplierConverter.toPO(collection));
	}
	
	@Override
	public int updateSupplier(SupplierBO supplierBO) {
		return supplierDao.updateSupplier(SupplierConverter.toPO(supplierBO));
	}
	
	@Override
	public int deleteSupplier(Long supplierId) {
		return supplierDao.deleteSupplier(supplierId);
	}
	
	@Override
	public SupplierBO getSupplier(Long supplierId) {
		return SupplierConverter.fromPO(supplierDao.getSupplier(supplierId));
	}
	
	@Override
	public List<SupplierBO> listSupplierById(Collection<Long> collection) {
		return SupplierConverter.fromPO(supplierDao.listSupplierById(collection));
	}
	
	@Override
	public List<SupplierBO> listSupplier(SupplierQuery query) {
		return SupplierConverter.fromPO(supplierDao.listSupplier(query));
	}
	
	@Override
	public int countSupplier(SupplierQuery query) {
		return supplierDao.countSupplier(query);
	}
	
}
